Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@types/classnames
Advanced tools
Stub TypeScript definitions entry for classnames, which provides its own types definitions
The @types/classnames package provides TypeScript type definitions for the classnames library, which is a utility for conditionally joining classNames together. This package is useful for TypeScript users who want to ensure type safety when using classnames to dynamically generate class strings based on certain conditions.
Basic usage with strings
Combine multiple class names into a single string.
classNames('foo', 'bar'); // 'foo bar'
Using objects to conditionally apply classes
Apply classes based on the truthiness of the associated value.
classNames({ 'foo': true, 'bar': false }); // 'foo'
Combining types
Mix strings and objects to conditionally apply classes.
classNames('foo', { 'bar': true }, 'baz', { 'qux': false }); // 'foo bar baz'
Using arrays
Pass arrays of class names to be joined together.
classNames(['foo', 'bar'], ['baz']); // 'foo bar baz'
clsx is a tiny utility for constructing className strings conditionally. It is similar to classnames but offers a more optimized, faster implementation with a smaller footprint.
Emotion is a performant and flexible CSS-in-JS library. While primarily focused on styling components, it includes the `cx` function, which is similar to classnames for combining class names based on conditions.
This is a stub types definition for @types/classnames (https://github.com/JedWatson/classnames#readme).
classnames provides its own type definitions, so you don't need @types/classnames installed!
FAQs
Stub TypeScript definitions entry for classnames, which provides its own types definitions
We found that @types/classnames demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.